/**
 * @param id - 班级 id
 */
interface FetchPhotosAPIParams {
  id: string
  page: string
  limit: string
}

interface FetchPhotosAPIResData {
  code: number
  msg: string
  time: string
  data: {
    data: Photo[]
    current_page: number
    total: number
    per_page: number
    last_page: number
  }
}

/**
 * @description 根据传入的班级 id，分页获取“班级相册”数据
 */
export function fetchPhotosAPI(params: FetchPhotosAPIParams, token: string) {
  return httpInstance.get<FetchPhotosAPIResData, FetchPhotosAPIParams>(
    '/api/sign/albumlist',
    { params, headers: { token } },
  )
}
